package main

import (
	"fmt"
	"reflect"
)

func main()  {
	test1()

}

func test1()  {

	user := User{"小二", 21, "男"}

	//rTpte := reflect.TypeOf(user)
	rValue:= reflect.ValueOf(user)

	method := rValue.Method(0)

	value := reflect.ValueOf("hello")
	args := []reflect.Value{value}
	value2 := method.Call(args)

	fmt.Println(value2)

}



type User struct {
	Name string
	Age int
	Sex string
}

func (user User) Say(msg string) error {
	fmt.Println("say:", msg)
	return nil
}

